import { createRouter, createWebHashHistory } from 'vue-router'

import Home from './views/Home.vue'
import About from './views/About.vue'
import Dashboard from './views/Dashboard.vue'
import Login from './views/Login.vue'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    // 顶层路由如何寻找：引起一整个屏幕发生变化的就是顶级路由
    {
      path: '/',
      component: Home,
      children: [
        {
          path: 'about',
          component: About
        },
        {
          path: 'dashboard',
          component: Dashboard
        }
      ]
    },
    {
      path: '/login',
      component: Login
    }
  ]
})

export default router
